<!--根据这个页单独设置样式-->
<style>
    .table-responsive{overflow-x: inherit}
    td{ vertical-align: middle!important;}
    .pagination{ margin:0!important;}
</style>
<script type="text/ng-template" id="addUser.html">
    <div class="modal-header">
        <h3 class="modal-title">修改密码</h3>
    </div>
    <div class="modal-body">
        <div class="row">
            <div class="col-sm-12">
                <form name="form" class="form-validation">
                    <div class="form-group">
                        <label>新密码</label>
                        <input type="text" class="form-control"
                               ng-model="password"  required >
                    </div>
                </form>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-sm btn-danger" ng-click="cancel()">Cancel</button>
        <button class="btn btn-sm btn-success" ng-click="ok()">OK</button>
    </div>
</script>

<div>
    <div class="bg-light lter b-b wrapper-md">
        <h1 class="m-n font-thin h3">用户列表</h1>
    </div>
    <div class="padder-md m-b-none m-t" style="padding-top: 0">
        <div class="panel panel-default">
            <div class="panel-heading">用户列表</div>
            <div class="m-sm">
                <div class="clearfix">
                    <h5>搜索订单筛选项：</h5>
                    <div class="row wrapper" style="padding-bottom:0;">
                        <div class="col-sm-2 col-md-2 col-lg-2">
                            <input class="form-control ng-pristine ng-untouched ng-valid"
                                   ng-model="ctrl.vm.search.id" type="text" placeholder="id" >
                        </div>
                        <div class="col-sm-2 col-md-2 col-lg-2">
                            <input class="form-control ng-pristine ng-untouched ng-valid"
                                   ng-model="ctrl.vm.search.telid" type="text" placeholder="手机账户" >
                        </div>
                        <div class="col-sm-2 col-md-2 col-lg-2">
                            <input class="form-control ng-pristine ng-untouched ng-valid"
                                   ng-model="ctrl.vm.search.emailid" type="text" placeholder="邮箱账户" >
                        </div>
                        <div class="col-sm-2 col-md-2 col-lg-2">
                            <select class="form-control" ng-model="ctrl.vm.search.state">
                                <option value="">状态</option>
                                <option value="1">启用</option>
                                <option value="0">禁用</option>
                            </select>
                        </div>
                        <div class="col-sm-2 col-md-2 col-lg-2">
                            <p class="input-group">
                                <input type="text" class="form-control" uib-datepicker-popup ng-model="ctrl.vm.search.startTime"
                                       is-open="popup.opened" datepicker-options="dateOptions" ng-required="true" close-text="Close"
                                       placeholder="创建时间" ng-change="ctrl.vm.changeTimeS()"/>
                                <span class="input-group-btn">
                                    <button type="button" class="btn btn-default"
                                            ng-click="open()"><i class="glyphicon glyphicon-calendar"></i>
                                    </button>
                                </span>
                            </p>
                        </div>
                        <div class="col-sm-2 col-md-2 col-lg-2">
                            <p class="input-group">
                                <input type="text" class="form-control" uib-datepicker-popup ng-model="ctrl.vm.search.endTime"
                                       is-open="popup1.opened" datepicker-options="dateOptions" ng-required="true" close-text="Close"
                                       placeholder="结束时间" ng-change="ctrl.vm.changeTimeE()"/>
                                <span class="input-group-btn">
                                        <button type="button" class="btn btn-default"
                                                ng-click="open1()"><i
                                                class="glyphicon glyphicon-calendar"></i>
                                        </button>
                                    </span>
                            </p>
                        </div>
                    </div>
                    <div style="width: 100%" class="pull-right text-right">
                        <div>
                            <button class="btn btn-sm btn-default" type="button" ng-click="ctrl.vm.searchFn()">搜索</button>
                            <button class="btn btn-sm btn-dark" type="button" ng-click="ctrl.vm.reset()">重置</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="table-responsive">
                <table class="table table-striped b-t b-light">
                    <thead>
                    <tr>
                        <th>id</th>
                        <th>昵称</th>
                        <th>手机账户</th>
                        <th >邮箱账户</th>
                        <th>用户组</th>
                        <th>创建时间</th>
                        <th>状态</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr ng-repeat="data in ctrl.vm.data">
                        <td>{{data.id}}</td>
                        <td>{{data.nick_name}}</td>
                        <td>{{data.phone}}</td>
                        <td>{{data.email}}</td>
                        <td>{{data.level}}</td>
                        <td>{{data.created_at}}</td>
                        <td>
                            <span class="label bg-success" ng-if="data.status==1">启用</span>
                            <span class="label bg-info " ng-if="data.status==0">禁用</span>
                        </td>
                        <td>
                            <button class="btn btn-success btn-sm" ng-if="data.status==0" ng-click="ctrl.vm.qiyong(data.id)">启用</button>
                            <button class="btn btn-danger btn-sm"  ng-if="data.status==1" ng-click="ctrl.vm.jinyomg(data.id)">禁用</button>
                            <button class="btn btn-info btn-sm" ng-click="model.open(data.id)">修改密码</button>
                        </td>
                    </tr>
                    <tr ng-if="!ctrl.vm.data.length">
                        <td colspan="12" class="text-center">暂无数据！</td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <footer class="panel-footer">
                <div class="row">
                    <div class="col-sm-2 hidden-xs">
                        <select
                                class="input-sm form-control w-sm inline v-middle"
                                ng-model="placement.selected"
                                ng-options="o as o for o in placement.options"
                                ng-change="placement.changeFn()"
                        >
                        </select>
                        <i style="float: right;padding: 2% 15% 0 0">总计{{vm.page.total}}</i>
                    </div>
                    <div class="col-sm-10 text-right text-center-xs">
                        <div class="pagination pagination-sm m-t-none m-b-none">
                            <uib-pagination
                                    boundary-links="true"
                                    total-items="vm.page.total"
                                    max-size="placement.pageSize"
                                    items-per-page="placement.selected"
                                    ng-model="vm.page.current_page"
                                    ng-change="pageChanged()"
                                    class="pagination-sm"
                                    previous-text="&lsaquo;"
                                    next-text="&rsaquo;"
                                    first-text="&laquo;"
                                    last-text="&raquo;"
                            >
                            </uib-pagination>
                        </div>
                    </div>
                </div>
            </footer>
        </div>
    </div>
</div>